{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Playing_with_Titanic_Dataset.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/Tanu-N-Prabhu/Python/blob/master/Playing_with_Titanic_Dataset.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "hD3dcw0JdAot",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "<center>\n",
        "<img src=\"http://www.datavirtualizationblog.com/wp-content/uploads/2015/11/3-phases-of-data-analysis-b.jpg\" >\n",
        "</center>\n",
        "\n",
        "**This mini project or whatever you call it as was done with the help of the website down below, which helped me in understanding, analysing the data by scraping the data from the internet.**\n",
        "\n",
        "\n",
        "---\n",
        "\n",
        "\n",
        "[Getting started with Data Analysis with Python Pandas](https://towardsdatascience.com/getting-started-to-data-analysis-with-python-pandas-with-titanic-dataset-a195ab043c77\n",
        ")\n",
        "\n",
        "---\n",
        "\n",
        "More importantly the \"Titanic\" dataset was retrived from Kaggle and the link can be found below:\n",
        "\n",
        "[Titanic Dataset](https://www.kaggle.com/c/titanic/data)\n",
        "\n",
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "qI3t3D-UqxZo",
        "colab_type": "text"
      },
      "source": [
        "The following two lines of code must be entered in order to upload the file from the local drive, because google colab stores everything in your drive. So make sure that you that you read the article down below before you begin typing the code. Moreover, I dont want you guys to stuck and watch the screen when you get an error.\n",
        "\n",
        "[Click Here](https://towardsdatascience.com/3-ways-to-load-csv-files-into-colab-7c14fcbdcb92)"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "YM_Dq2ZAlaA2",
        "colab_type": "code",
        "outputId": "3e580035-651c-46fa-b1e1-1e81222dadf6",
        "colab": {
          "resources": {
            "http://localhost:8080/nbextensions/google.colab/files.js": {
              "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgovLyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLy8KLy8gICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLy8KLy8gVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQovLyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAovLyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLy8gU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAovLyBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KCi8qKgogKiBAZmlsZW92ZXJ2aWV3IEhlbHBlcnMgZm9yIGdvb2dsZS5jb2xhYiBQeXRob24gbW9kdWxlLgogKi8KKGZ1bmN0aW9uKHNjb3BlKSB7CmZ1bmN0aW9uIHNwYW4odGV4dCwgc3R5bGVBdHRyaWJ1dGVzID0ge30pIHsKICBjb25zdCBlbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpOwogIGVsZW1lbnQudGV4dENvbnRlbnQgPSB0ZXh0OwogIGZvciAoY29uc3Qga2V5IG9mIE9iamVjdC5rZXlzKHN0eWxlQXR0cmlidXRlcykpIHsKICAgIGVsZW1lbnQuc3R5bGVba2V5XSA9IHN0eWxlQXR0cmlidXRlc1trZXldOwogIH0KICByZXR1cm4gZWxlbWVudDsKfQoKLy8gTWF4IG51bWJlciBvZiBieXRlcyB3aGljaCB3aWxsIGJlIHVwbG9hZGVkIGF0IGEgdGltZS4KY29uc3QgTUFYX1BBWUxPQURfU0laRSA9IDEwMCAqIDEwMjQ7Ci8vIE1heCBhbW91bnQgb2YgdGltZSB0byBibG9jayB3YWl0aW5nIGZvciB0aGUgdXNlci4KY29uc3QgRklMRV9DSEFOR0VfVElNRU9VVF9NUyA9IDMwICogMTAwMDsKCmZ1bmN0aW9uIF91cGxvYWRGaWxlcyhpbnB1dElkLCBvdXRwdXRJZCkgewogIGNvbnN0IHN0ZXBzID0gdXBsb2FkRmlsZXNTdGVwKGlucHV0SWQsIG91dHB1dElkKTsKICBjb25zdCBvdXRwdXRFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQob3V0cHV0SWQpOwogIC8vIENhY2hlIHN0ZXBzIG9uIHRoZSBvdXRwdXRFbGVtZW50IHRvIG1ha2UgaXQgYXZhaWxhYmxlIGZvciB0aGUgbmV4dCBjYWxsCiAgLy8gdG8gdXBsb2FkRmlsZXNDb250aW51ZSBmcm9tIFB5dGhvbi4KICBvdXRwdXRFbGVtZW50LnN0ZXBzID0gc3RlcHM7CgogIHJldHVybiBfdXBsb2FkRmlsZXNDb250aW51ZShvdXRwdXRJZCk7Cn0KCi8vIFRoaXMgaXMgcm91Z2hseSBhbiBhc3luYyBnZW5lcmF0b3IgKG5vdCBzdXBwb3J0ZWQgaW4gdGhlIGJyb3dzZXIgeWV0KSwKLy8gd2hlcmUgdGhlcmUgYXJlIG11bHRpcGxlIGFzeW5jaHJvbm91cyBzdGVwcyBhbmQgdGhlIFB5dGhvbiBzaWRlIGlzIGdvaW5nCi8vIHRvIHBvbGwgZm9yIGNvbXBsZXRpb24gb2YgZWFjaCBzdGVwLgovLyBUaGlzIHVzZXMgYSBQcm9taXNlIHRvIGJsb2NrIHRoZSBweXRob24gc2lkZSBvbiBjb21wbGV0aW9uIG9mIGVhY2ggc3RlcCwKLy8gdGhlbiBwYXNzZXMgdGhlIHJlc3VsdCBvZiB0aGUgcHJldmlvdXMgc3RlcCBhcyB0aGUgaW5wdXQgdG8gdGhlIG5leHQgc3RlcC4KZnVuY3Rpb24gX3VwbG9hZEZpbGVzQ29udGludWUob3V0cHV0SWQpIHsKICBjb25zdCBvdXRwdXRFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQob3V0cHV0SWQpOwogIGNvbnN0IHN0ZXBzID0gb3V0cHV0RWxlbWVudC5zdGVwczsKCiAgY29uc3QgbmV4dCA9IHN0ZXBzLm5leHQob3V0cHV0RWxlbWVudC5sYXN0UHJvbWlzZVZhbHVlKTsKICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKG5leHQudmFsdWUucHJvbWlzZSkudGhlbigodmFsdWUpID0+IHsKICAgIC8vIENhY2hlIHRoZSBsYXN0IHByb21pc2UgdmFsdWUgdG8gbWFrZSBpdCBhdmFpbGFibGUgdG8gdGhlIG5leHQKICAgIC8vIHN0ZXAgb2YgdGhlIGdlbmVyYXRvci4KICAgIG91dHB1dEVsZW1lbnQubGFzdFByb21pc2VWYWx1ZSA9IHZhbHVlOwogICAgcmV0dXJuIG5leHQudmFsdWUucmVzcG9uc2U7CiAgfSk7Cn0KCi8qKgogKiBHZW5lcmF0b3IgZnVuY3Rpb24gd2hpY2ggaXMgY2FsbGVkIGJldHdlZW4gZWFjaCBhc3luYyBzdGVwIG9mIHRoZSB1cGxvYWQKICogcHJvY2Vzcy4KICogQHBhcmFtIHtzdHJpbmd9IGlucHV0SWQgRWxlbWVudCBJRCBvZiB0aGUgaW5wdXQgZmlsZSBwaWNrZXIgZWxlbWVudC4KICogQHBhcmFtIHtzdHJpbmd9IG91dHB1dElkIEVsZW1lbnQgSUQgb2YgdGhlIG91dHB1dCBkaXNwbGF5LgogKiBAcmV0dXJuIHshSXRlcmFibGU8IU9iamVjdD59IEl0ZXJhYmxlIG9mIG5leHQgc3RlcHMuCiAqLwpmdW5jdGlvbiogdXBsb2FkRmlsZXNTdGVwKGlucHV0SWQsIG91dHB1dElkKSB7CiAgY29uc3QgaW5wdXRFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoaW5wdXRJZCk7CiAgaW5wdXRFbGVtZW50LmRpc2FibGVkID0gZmFsc2U7CgogIGNvbnN0IG91dHB1dEVsZW1lbnQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChvdXRwdXRJZCk7CiAgb3V0cHV0RWxlbWVudC5pbm5lckhUTUwgPSAnJzsKCiAgY29uc3QgcGlja2VkUHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7CiAgICBpbnB1dEVsZW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKGUpID0+IHsKICAgICAgcmVzb2x2ZShlLnRhcmdldC5maWxlcyk7CiAgICB9KTsKICB9KTsKCiAgY29uc3QgY2FuY2VsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CiAgaW5wdXRFbGVtZW50LnBhcmVudEVsZW1lbnQuYXBwZW5kQ2hpbGQoY2FuY2VsKTsKICBjYW5jZWwudGV4dENvbnRlbnQgPSAnQ2FuY2VsIHVwbG9hZCc7CiAgY29uc3QgY2FuY2VsUHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7CiAgICBjYW5jZWwub25jbGljayA9ICgpID0+IHsKICAgICAgcmVzb2x2ZShudWxsKTsKICAgIH07CiAgfSk7CgogIC8vIENhbmNlbCB1cGxvYWQgaWYgdXNlciBoYXNuJ3QgcGlja2VkIGFueXRoaW5nIGluIHRpbWVvdXQuCiAgY29uc3QgdGltZW91dFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gewogICAgc2V0VGltZW91dCgoKSA9PiB7CiAgICAgIHJlc29sdmUobnVsbCk7CiAgICB9LCBGSUxFX0NIQU5HRV9USU1FT1VUX01TKTsKICB9KTsKCiAgLy8gV2FpdCBmb3IgdGhlIHVzZXIgdG8gcGljayB0aGUgZmlsZXMuCiAgY29uc3QgZmlsZXMgPSB5aWVsZCB7CiAgICBwcm9taXNlOiBQcm9taXNlLnJhY2UoW3BpY2tlZFByb21pc2UsIHRpbWVvdXRQcm9taXNlLCBjYW5jZWxQcm9taXNlXSksCiAgICByZXNwb25zZTogewogICAgICBhY3Rpb246ICdzdGFydGluZycsCiAgICB9CiAgfTsKCiAgaWYgKCFmaWxlcykgewogICAgcmV0dXJuIHsKICAgICAgcmVzcG9uc2U6IHsKICAgICAgICBhY3Rpb246ICdjb21wbGV0ZScsCiAgICAgIH0KICAgIH07CiAgfQoKICBjYW5jZWwucmVtb3ZlKCk7CgogIC8vIERpc2FibGUgdGhlIGlucHV0IGVsZW1lbnQgc2luY2UgZnVydGhlciBwaWNrcyBhcmUgbm90IGFsbG93ZWQuCiAgaW5wdXRFbGVtZW50LmRpc2FibGVkID0gdHJ1ZTsKCiAgZm9yIChjb25zdCBmaWxlIG9mIGZpbGVzKSB7CiAgICBjb25zdCBsaSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2xpJyk7CiAgICBsaS5hcHBlbmQoc3BhbihmaWxlLm5hbWUsIHtmb250V2VpZ2h0OiAnYm9sZCd9KSk7CiAgICBsaS5hcHBlbmQoc3BhbigKICAgICAgICBgKCR7ZmlsZS50eXBlIHx8ICduL2EnfSkgLSAke2ZpbGUuc2l6ZX0gYnl0ZXMsIGAgKwogICAgICAgIGBsYXN0IG1vZGlmaWVkOiAkewogICAgICAgICAgICBmaWxlLmxhc3RNb2RpZmllZERhdGUgPyBmaWxlLmxhc3RNb2RpZmllZERhdGUudG9Mb2NhbGVEYXRlU3RyaW5nKCkgOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbi9hJ30gLSBgKSk7CiAgICBjb25zdCBwZXJjZW50ID0gc3BhbignMCUgZG9uZScpOwogICAgbGkuYXBwZW5kQ2hpbGQocGVyY2VudCk7CgogICAgb3V0cHV0RWxlbWVudC5hcHBlbmRDaGlsZChsaSk7CgogICAgY29uc3QgZmlsZURhdGFQcm9taXNlID0gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHsKICAgICAgY29uc3QgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKTsKICAgICAgcmVhZGVyLm9ubG9hZCA9IChlKSA9PiB7CiAgICAgICAgcmVzb2x2ZShlLnRhcmdldC5yZXN1bHQpOwogICAgICB9OwogICAgICByZWFkZXIucmVhZEFzQXJyYXlCdWZmZXIoZmlsZSk7CiAgICB9KTsKICAgIC8vIFdhaXQgZm9yIHRoZSBkYXRhIHRvIGJlIHJlYWR5LgogICAgbGV0IGZpbGVEYXRhID0geWllbGQgewogICAgICBwcm9taXNlOiBmaWxlRGF0YVByb21pc2UsCiAgICAgIHJlc3BvbnNlOiB7CiAgICAgICAgYWN0aW9uOiAnY29udGludWUnLAogICAgICB9CiAgICB9OwoKICAgIC8vIFVzZSBhIGNodW5rZWQgc2VuZGluZyB0byBhdm9pZCBtZXNzYWdlIHNpemUgbGltaXRzLiBTZWUgYi82MjExNTY2MC4KICAgIGxldCBwb3NpdGlvbiA9IDA7CiAgICB3aGlsZSAocG9zaXRpb24gPCBmaWxlRGF0YS5ieXRlTGVuZ3RoKSB7CiAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWluKGZpbGVEYXRhLmJ5dGVMZW5ndGggLSBwb3NpdGlvbiwgTUFYX1BBWUxPQURfU0laRSk7CiAgICAgIGNvbnN0IGNodW5rID0gbmV3IFVpbnQ4QXJyYXkoZmlsZURhdGEsIHBvc2l0aW9uLCBsZW5ndGgpOwogICAgICBwb3NpdGlvbiArPSBsZW5ndGg7CgogICAgICBjb25zdCBiYXNlNjQgPSBidG9hKFN0cmluZy5mcm9tQ2hhckNvZGUuYXBwbHkobnVsbCwgY2h1bmspKTsKICAgICAgeWllbGQgewogICAgICAgIHJlc3BvbnNlOiB7CiAgICAgICAgICBhY3Rpb246ICdhcHBlbmQnLAogICAgICAgICAgZmlsZTogZmlsZS5uYW1lLAogICAgICAgICAgZGF0YTogYmFzZTY0LAogICAgICAgIH0sCiAgICAgIH07CiAgICAgIHBlcmNlbnQudGV4dENvbnRlbnQgPQogICAgICAgICAgYCR7TWF0aC5yb3VuZCgocG9zaXRpb24gLyBmaWxlRGF0YS5ieXRlTGVuZ3RoKSAqIDEwMCl9JSBkb25lYDsKICAgIH0KICB9CgogIC8vIEFsbCBkb25lLgogIHlpZWxkIHsKICAgIHJlc3BvbnNlOiB7CiAgICAgIGFjdGlvbjogJ2NvbXBsZXRlJywKICAgIH0KICB9Owp9CgpzY29wZS5nb29nbGUgPSBzY29wZS5nb29nbGUgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYiA9IHNjb3BlLmdvb2dsZS5jb2xhYiB8fCB7fTsKc2NvcGUuZ29vZ2xlLmNvbGFiLl9maWxlcyA9IHsKICBfdXBsb2FkRmlsZXMsCiAgX3VwbG9hZEZpbGVzQ29udGludWUsCn07Cn0pKHNlbGYpOwo=",
              "ok": true,
              "headers": [
                [
                  "content-type",
                  "application/javascript"
                ]
              ],
              "status": 200,
              "status_text": ""
            }
          },
          "base_uri": "https://localhost:8080/",
          "height": 75
        }
      },
      "source": [
        "from google.colab import files\n",
        "uploaded = files.upload()"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "\n",
              "     <input type=\"file\" id=\"files-4678cd8f-5114-4504-a19d-15d7330fb3d6\" name=\"files[]\" multiple disabled />\n",
              "     <output id=\"result-4678cd8f-5114-4504-a19d-15d7330fb3d6\">\n",
              "      Upload widget is only available when the cell has been executed in the\n",
              "      current browser session. Please rerun this cell to enable.\n",
              "      </output>\n",
              "      <script src=\"/nbextensions/google.colab/files.js\"></script> "
            ],
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Saving train.csv to train.csv\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "CsdIJ9lAsS6G",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "After entering the above two lines of code, wait till you get the 100% uploaded confirmation. Finally once you get that, please enter the two more lines (I really don't know what the two line does)\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "71vMqOu7ljTo",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import io\n",
        "df2 = pd.read_csv(io.BytesIO(uploaded['train.csv']))"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MjBBMJ-wRKpZ",
        "colab_type": "text"
      },
      "source": [
        "# Importing the dataset with read_csv and displaying the data.\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ORH0fyc7Wlh9",
        "colab_type": "code",
        "outputId": "1c9048e7-f669-4b7f-8914-b940f1cad169",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 2157
        }
      },
      "source": [
        "import pandas as pd\n",
        "import csv\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "df = pd.read_csv(\"train.csv\")\n",
        "df"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "      <th>SibSp</th>\n",
              "      <th>Parch</th>\n",
              "      <th>Ticket</th>\n",
              "      <th>Fare</th>\n",
              "      <th>Cabin</th>\n",
              "      <th>Embarked</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Braund, Mr. Owen Harris</td>\n",
              "      <td>male</td>\n",
              "      <td>22.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>A/5 21171</td>\n",
              "      <td>7.2500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
              "      <td>female</td>\n",
              "      <td>38.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>PC 17599</td>\n",
              "      <td>71.2833</td>\n",
              "      <td>C85</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Heikkinen, Miss. Laina</td>\n",
              "      <td>female</td>\n",
              "      <td>26.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>STON/O2. 3101282</td>\n",
              "      <td>7.9250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
              "      <td>female</td>\n",
              "      <td>35.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>113803</td>\n",
              "      <td>53.1000</td>\n",
              "      <td>C123</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Allen, Mr. William Henry</td>\n",
              "      <td>male</td>\n",
              "      <td>35.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>373450</td>\n",
              "      <td>8.0500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>6</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moran, Mr. James</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>330877</td>\n",
              "      <td>8.4583</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>7</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>McCarthy, Mr. Timothy J</td>\n",
              "      <td>male</td>\n",
              "      <td>54.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>17463</td>\n",
              "      <td>51.8625</td>\n",
              "      <td>E46</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>8</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Palsson, Master. Gosta Leonard</td>\n",
              "      <td>male</td>\n",
              "      <td>2.0</td>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>349909</td>\n",
              "      <td>21.0750</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>9</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)</td>\n",
              "      <td>female</td>\n",
              "      <td>27.0</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>347742</td>\n",
              "      <td>11.1333</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>10</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Nasser, Mrs. Nicholas (Adele Achem)</td>\n",
              "      <td>female</td>\n",
              "      <td>14.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>237736</td>\n",
              "      <td>30.0708</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>11</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Sandstrom, Miss. Marguerite Rut</td>\n",
              "      <td>female</td>\n",
              "      <td>4.0</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>PP 9549</td>\n",
              "      <td>16.7000</td>\n",
              "      <td>G6</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>12</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Bonnell, Miss. Elizabeth</td>\n",
              "      <td>female</td>\n",
              "      <td>58.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>113783</td>\n",
              "      <td>26.5500</td>\n",
              "      <td>C103</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>13</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Saundercock, Mr. William Henry</td>\n",
              "      <td>male</td>\n",
              "      <td>20.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>A/5. 2151</td>\n",
              "      <td>8.0500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>14</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Andersson, Mr. Anders Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>39.0</td>\n",
              "      <td>1</td>\n",
              "      <td>5</td>\n",
              "      <td>347082</td>\n",
              "      <td>31.2750</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>15</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Vestrom, Miss. Hulda Amanda Adolfina</td>\n",
              "      <td>female</td>\n",
              "      <td>14.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>350406</td>\n",
              "      <td>7.8542</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>16</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Hewlett, Mrs. (Mary D Kingcome)</td>\n",
              "      <td>female</td>\n",
              "      <td>55.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>248706</td>\n",
              "      <td>16.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>17</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Rice, Master. Eugene</td>\n",
              "      <td>male</td>\n",
              "      <td>2.0</td>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>382652</td>\n",
              "      <td>29.1250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>18</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Williams, Mr. Charles Eugene</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>244373</td>\n",
              "      <td>13.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>19</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Vander Planke, Mrs. Julius (Emelia Maria Vande...</td>\n",
              "      <td>female</td>\n",
              "      <td>31.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>345763</td>\n",
              "      <td>18.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>20</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Masselmani, Mrs. Fatima</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>2649</td>\n",
              "      <td>7.2250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>21</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Fynney, Mr. Joseph J</td>\n",
              "      <td>male</td>\n",
              "      <td>35.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>239865</td>\n",
              "      <td>26.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>22</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Beesley, Mr. Lawrence</td>\n",
              "      <td>male</td>\n",
              "      <td>34.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>248698</td>\n",
              "      <td>13.0000</td>\n",
              "      <td>D56</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>23</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>McGowan, Miss. Anna \"Annie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>15.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>330923</td>\n",
              "      <td>8.0292</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>24</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Sloper, Mr. William Thompson</td>\n",
              "      <td>male</td>\n",
              "      <td>28.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>113788</td>\n",
              "      <td>35.5000</td>\n",
              "      <td>A6</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>25</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Palsson, Miss. Torborg Danira</td>\n",
              "      <td>female</td>\n",
              "      <td>8.0</td>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>349909</td>\n",
              "      <td>21.0750</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>26</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Asplund, Mrs. Carl Oscar (Selma Augusta Emilia...</td>\n",
              "      <td>female</td>\n",
              "      <td>38.0</td>\n",
              "      <td>1</td>\n",
              "      <td>5</td>\n",
              "      <td>347077</td>\n",
              "      <td>31.3875</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>27</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Emir, Mr. Farred Chehab</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>2631</td>\n",
              "      <td>7.2250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>28</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Fortune, Mr. Charles Alexander</td>\n",
              "      <td>male</td>\n",
              "      <td>19.0</td>\n",
              "      <td>3</td>\n",
              "      <td>2</td>\n",
              "      <td>19950</td>\n",
              "      <td>263.0000</td>\n",
              "      <td>C23 C25 C27</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>29</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>O'Dwyer, Miss. Ellen \"Nellie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>330959</td>\n",
              "      <td>7.8792</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>30</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Todoroff, Mr. Lalio</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>349216</td>\n",
              "      <td>7.8958</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>861</th>\n",
              "      <td>862</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Giles, Mr. Frederick Edward</td>\n",
              "      <td>male</td>\n",
              "      <td>21.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>28134</td>\n",
              "      <td>11.5000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>862</th>\n",
              "      <td>863</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Swift, Mrs. Frederick Joel (Margaret Welles Ba...</td>\n",
              "      <td>female</td>\n",
              "      <td>48.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>17466</td>\n",
              "      <td>25.9292</td>\n",
              "      <td>D17</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>863</th>\n",
              "      <td>864</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Miss. Dorothy Edith \"Dolly\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "      <td>8</td>\n",
              "      <td>2</td>\n",
              "      <td>CA. 2343</td>\n",
              "      <td>69.5500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>864</th>\n",
              "      <td>865</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Gill, Mr. John William</td>\n",
              "      <td>male</td>\n",
              "      <td>24.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>233866</td>\n",
              "      <td>13.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>865</th>\n",
              "      <td>866</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Bystrom, Mrs. (Karolina)</td>\n",
              "      <td>female</td>\n",
              "      <td>42.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>236852</td>\n",
              "      <td>13.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>866</th>\n",
              "      <td>867</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Duran y More, Miss. Asuncion</td>\n",
              "      <td>female</td>\n",
              "      <td>27.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>SC/PARIS 2149</td>\n",
              "      <td>13.8583</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>867</th>\n",
              "      <td>868</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Roebling, Mr. Washington Augustus II</td>\n",
              "      <td>male</td>\n",
              "      <td>31.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>PC 17590</td>\n",
              "      <td>50.4958</td>\n",
              "      <td>A24</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>868</th>\n",
              "      <td>869</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>van Melkebeke, Mr. Philemon</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>345777</td>\n",
              "      <td>9.5000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>869</th>\n",
              "      <td>870</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnson, Master. Harold Theodor</td>\n",
              "      <td>male</td>\n",
              "      <td>4.0</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>347742</td>\n",
              "      <td>11.1333</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>870</th>\n",
              "      <td>871</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Balkic, Mr. Cerin</td>\n",
              "      <td>male</td>\n",
              "      <td>26.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>349248</td>\n",
              "      <td>7.8958</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>871</th>\n",
              "      <td>872</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Beckwith, Mrs. Richard Leonard (Sallie Monypeny)</td>\n",
              "      <td>female</td>\n",
              "      <td>47.0</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>11751</td>\n",
              "      <td>52.5542</td>\n",
              "      <td>D35</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>872</th>\n",
              "      <td>873</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Carlsson, Mr. Frans Olof</td>\n",
              "      <td>male</td>\n",
              "      <td>33.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>695</td>\n",
              "      <td>5.0000</td>\n",
              "      <td>B51 B53 B55</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>873</th>\n",
              "      <td>874</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Vander Cruyssen, Mr. Victor</td>\n",
              "      <td>male</td>\n",
              "      <td>47.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>345765</td>\n",
              "      <td>9.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>874</th>\n",
              "      <td>875</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Abelson, Mrs. Samuel (Hannah Wizosky)</td>\n",
              "      <td>female</td>\n",
              "      <td>28.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>P/PP 3381</td>\n",
              "      <td>24.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>875</th>\n",
              "      <td>876</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Najib, Miss. Adele Kiamie \"Jane\"</td>\n",
              "      <td>female</td>\n",
              "      <td>15.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>2667</td>\n",
              "      <td>7.2250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>876</th>\n",
              "      <td>877</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Gustafsson, Mr. Alfred Ossian</td>\n",
              "      <td>male</td>\n",
              "      <td>20.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>7534</td>\n",
              "      <td>9.8458</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>877</th>\n",
              "      <td>878</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Petroff, Mr. Nedelio</td>\n",
              "      <td>male</td>\n",
              "      <td>19.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>349212</td>\n",
              "      <td>7.8958</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>878</th>\n",
              "      <td>879</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Laleff, Mr. Kristo</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>349217</td>\n",
              "      <td>7.8958</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>879</th>\n",
              "      <td>880</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Potter, Mrs. Thomas Jr (Lily Alexenia Wilson)</td>\n",
              "      <td>female</td>\n",
              "      <td>56.0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>11767</td>\n",
              "      <td>83.1583</td>\n",
              "      <td>C50</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>880</th>\n",
              "      <td>881</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Shelley, Mrs. William (Imanita Parrish Hall)</td>\n",
              "      <td>female</td>\n",
              "      <td>25.0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>230433</td>\n",
              "      <td>26.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>881</th>\n",
              "      <td>882</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Markun, Mr. Johann</td>\n",
              "      <td>male</td>\n",
              "      <td>33.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>349257</td>\n",
              "      <td>7.8958</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>882</th>\n",
              "      <td>883</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Dahlberg, Miss. Gerda Ulrika</td>\n",
              "      <td>female</td>\n",
              "      <td>22.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>7552</td>\n",
              "      <td>10.5167</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>883</th>\n",
              "      <td>884</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Banfield, Mr. Frederick James</td>\n",
              "      <td>male</td>\n",
              "      <td>28.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>C.A./SOTON 34068</td>\n",
              "      <td>10.5000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>884</th>\n",
              "      <td>885</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sutehall, Mr. Henry Jr</td>\n",
              "      <td>male</td>\n",
              "      <td>25.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>SOTON/OQ 392076</td>\n",
              "      <td>7.0500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>885</th>\n",
              "      <td>886</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Rice, Mrs. William (Margaret Norton)</td>\n",
              "      <td>female</td>\n",
              "      <td>39.0</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>382652</td>\n",
              "      <td>29.1250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>886</th>\n",
              "      <td>887</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Montvila, Rev. Juozas</td>\n",
              "      <td>male</td>\n",
              "      <td>27.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>211536</td>\n",
              "      <td>13.0000</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>887</th>\n",
              "      <td>888</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Graham, Miss. Margaret Edith</td>\n",
              "      <td>female</td>\n",
              "      <td>19.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>112053</td>\n",
              "      <td>30.0000</td>\n",
              "      <td>B42</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>888</th>\n",
              "      <td>889</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Miss. Catherine Helen \"Carrie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>W./C. 6607</td>\n",
              "      <td>23.4500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>889</th>\n",
              "      <td>890</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Behr, Mr. Karl Howell</td>\n",
              "      <td>male</td>\n",
              "      <td>26.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>111369</td>\n",
              "      <td>30.0000</td>\n",
              "      <td>C148</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>890</th>\n",
              "      <td>891</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Dooley, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>32.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>370376</td>\n",
              "      <td>7.7500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>891 rows × 12 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  Pclass  ...      Fare        Cabin  Embarked\n",
              "0              1         0       3  ...    7.2500          NaN         S\n",
              "1              2         1       1  ...   71.2833          C85         C\n",
              "2              3         1       3  ...    7.9250          NaN         S\n",
              "3              4         1       1  ...   53.1000         C123         S\n",
              "4              5         0       3  ...    8.0500          NaN         S\n",
              "5              6         0       3  ...    8.4583          NaN         Q\n",
              "6              7         0       1  ...   51.8625          E46         S\n",
              "7              8         0       3  ...   21.0750          NaN         S\n",
              "8              9         1       3  ...   11.1333          NaN         S\n",
              "9             10         1       2  ...   30.0708          NaN         C\n",
              "10            11         1       3  ...   16.7000           G6         S\n",
              "11            12         1       1  ...   26.5500         C103         S\n",
              "12            13         0       3  ...    8.0500          NaN         S\n",
              "13            14         0       3  ...   31.2750          NaN         S\n",
              "14            15         0       3  ...    7.8542          NaN         S\n",
              "15            16         1       2  ...   16.0000          NaN         S\n",
              "16            17         0       3  ...   29.1250          NaN         Q\n",
              "17            18         1       2  ...   13.0000          NaN         S\n",
              "18            19         0       3  ...   18.0000          NaN         S\n",
              "19            20         1       3  ...    7.2250          NaN         C\n",
              "20            21         0       2  ...   26.0000          NaN         S\n",
              "21            22         1       2  ...   13.0000          D56         S\n",
              "22            23         1       3  ...    8.0292          NaN         Q\n",
              "23            24         1       1  ...   35.5000           A6         S\n",
              "24            25         0       3  ...   21.0750          NaN         S\n",
              "25            26         1       3  ...   31.3875          NaN         S\n",
              "26            27         0       3  ...    7.2250          NaN         C\n",
              "27            28         0       1  ...  263.0000  C23 C25 C27         S\n",
              "28            29         1       3  ...    7.8792          NaN         Q\n",
              "29            30         0       3  ...    7.8958          NaN         S\n",
              "..           ...       ...     ...  ...       ...          ...       ...\n",
              "861          862         0       2  ...   11.5000          NaN         S\n",
              "862          863         1       1  ...   25.9292          D17         S\n",
              "863          864         0       3  ...   69.5500          NaN         S\n",
              "864          865         0       2  ...   13.0000          NaN         S\n",
              "865          866         1       2  ...   13.0000          NaN         S\n",
              "866          867         1       2  ...   13.8583          NaN         C\n",
              "867          868         0       1  ...   50.4958          A24         S\n",
              "868          869         0       3  ...    9.5000          NaN         S\n",
              "869          870         1       3  ...   11.1333          NaN         S\n",
              "870          871         0       3  ...    7.8958          NaN         S\n",
              "871          872         1       1  ...   52.5542          D35         S\n",
              "872          873         0       1  ...    5.0000  B51 B53 B55         S\n",
              "873          874         0       3  ...    9.0000          NaN         S\n",
              "874          875         1       2  ...   24.0000          NaN         C\n",
              "875          876         1       3  ...    7.2250          NaN         C\n",
              "876          877         0       3  ...    9.8458          NaN         S\n",
              "877          878         0       3  ...    7.8958          NaN         S\n",
              "878          879         0       3  ...    7.8958          NaN         S\n",
              "879          880         1       1  ...   83.1583          C50         C\n",
              "880          881         1       2  ...   26.0000          NaN         S\n",
              "881          882         0       3  ...    7.8958          NaN         S\n",
              "882          883         0       3  ...   10.5167          NaN         S\n",
              "883          884         0       2  ...   10.5000          NaN         S\n",
              "884          885         0       3  ...    7.0500          NaN         S\n",
              "885          886         0       3  ...   29.1250          NaN         Q\n",
              "886          887         0       2  ...   13.0000          NaN         S\n",
              "887          888         1       1  ...   30.0000          B42         S\n",
              "888          889         0       3  ...   23.4500          NaN         S\n",
              "889          890         1       1  ...   30.0000         C148         C\n",
              "890          891         0       3  ...    7.7500          NaN         Q\n",
              "\n",
              "[891 rows x 12 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Mr_mxZgnQ2uQ",
        "colab_type": "text"
      },
      "source": [
        "# **Using Head and Tail methods inorder to display the data.**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6GO30V6Sczk3",
        "colab_type": "code",
        "outputId": "58072394-e095-40d0-f5ae-06762aeb3560",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df.head(5)  # Used to display top 5"
      ],
      "execution_count": 8,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "      <th>SibSp</th>\n",
              "      <th>Parch</th>\n",
              "      <th>Ticket</th>\n",
              "      <th>Fare</th>\n",
              "      <th>Cabin</th>\n",
              "      <th>Embarked</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Braund, Mr. Owen Harris</td>\n",
              "      <td>male</td>\n",
              "      <td>22.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>A/5 21171</td>\n",
              "      <td>7.2500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
              "      <td>female</td>\n",
              "      <td>38.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>PC 17599</td>\n",
              "      <td>71.2833</td>\n",
              "      <td>C85</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Heikkinen, Miss. Laina</td>\n",
              "      <td>female</td>\n",
              "      <td>26.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>STON/O2. 3101282</td>\n",
              "      <td>7.9250</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
              "      <td>female</td>\n",
              "      <td>35.0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>113803</td>\n",
              "      <td>53.1000</td>\n",
              "      <td>C123</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Allen, Mr. William Henry</td>\n",
              "      <td>male</td>\n",
              "      <td>35.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>373450</td>\n",
              "      <td>8.0500</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   PassengerId  Survived  Pclass  ...     Fare Cabin  Embarked\n",
              "0            1         0       3  ...   7.2500   NaN         S\n",
              "1            2         1       1  ...  71.2833   C85         C\n",
              "2            3         1       3  ...   7.9250   NaN         S\n",
              "3            4         1       1  ...  53.1000  C123         S\n",
              "4            5         0       3  ...   8.0500   NaN         S\n",
              "\n",
              "[5 rows x 12 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 8
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "zcxr2dnFhT5h",
        "colab_type": "code",
        "outputId": "f1006878-059b-4082-f2f8-9c3637c8e972",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df.tail(5) # Used to display last 5"
      ],
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "      <th>SibSp</th>\n",
              "      <th>Parch</th>\n",
              "      <th>Ticket</th>\n",
              "      <th>Fare</th>\n",
              "      <th>Cabin</th>\n",
              "      <th>Embarked</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>886</th>\n",
              "      <td>887</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Montvila, Rev. Juozas</td>\n",
              "      <td>male</td>\n",
              "      <td>27.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>211536</td>\n",
              "      <td>13.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>887</th>\n",
              "      <td>888</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Graham, Miss. Margaret Edith</td>\n",
              "      <td>female</td>\n",
              "      <td>19.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>112053</td>\n",
              "      <td>30.00</td>\n",
              "      <td>B42</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>888</th>\n",
              "      <td>889</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Miss. Catherine Helen \"Carrie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>W./C. 6607</td>\n",
              "      <td>23.45</td>\n",
              "      <td>NaN</td>\n",
              "      <td>S</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>889</th>\n",
              "      <td>890</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Behr, Mr. Karl Howell</td>\n",
              "      <td>male</td>\n",
              "      <td>26.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>111369</td>\n",
              "      <td>30.00</td>\n",
              "      <td>C148</td>\n",
              "      <td>C</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>890</th>\n",
              "      <td>891</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Dooley, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>32.0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>370376</td>\n",
              "      <td>7.75</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Q</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  Pclass  ...   Fare Cabin  Embarked\n",
              "886          887         0       2  ...  13.00   NaN         S\n",
              "887          888         1       1  ...  30.00   B42         S\n",
              "888          889         0       3  ...  23.45   NaN         S\n",
              "889          890         1       1  ...  30.00  C148         C\n",
              "890          891         0       3  ...   7.75   NaN         Q\n",
              "\n",
              "[5 rows x 12 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 9
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Tw84bFRrRUNJ",
        "colab_type": "text"
      },
      "source": [
        "# Accessing specific coloums which are needed."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wER50sYvhVPB",
        "colab_type": "code",
        "outputId": "82e28537-4784-4607-8042-c00a7c635898",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df = pd.read_csv(\"train.csv\", usecols= [\"PassengerId\", \"Survived\", \"Pclass\", \"Name\", \"Sex\",\"Age\"])\n",
        "df.head()"
      ],
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Braund, Mr. Owen Harris</td>\n",
              "      <td>male</td>\n",
              "      <td>22.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
              "      <td>female</td>\n",
              "      <td>38.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Heikkinen, Miss. Laina</td>\n",
              "      <td>female</td>\n",
              "      <td>26.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
              "      <td>female</td>\n",
              "      <td>35.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Allen, Mr. William Henry</td>\n",
              "      <td>male</td>\n",
              "      <td>35.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   PassengerId  Survived  ...     Sex   Age\n",
              "0            1         0  ...    male  22.0\n",
              "1            2         1  ...  female  38.0\n",
              "2            3         1  ...  female  26.0\n",
              "3            4         1  ...  female  35.0\n",
              "4            5         0  ...    male  35.0\n",
              "\n",
              "[5 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 10
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "fsNH60Q6RhCL",
        "colab_type": "text"
      },
      "source": [
        "# Get more information about the database by using describe method."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Qb4YdAa_hozX",
        "colab_type": "code",
        "outputId": "6c83d200-eadc-48fd-97d4-1ca966b75048",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 294
        }
      },
      "source": [
        "df.describe()"
      ],
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>count</th>\n",
              "      <td>891.000000</td>\n",
              "      <td>891.000000</td>\n",
              "      <td>891.000000</td>\n",
              "      <td>714.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>mean</th>\n",
              "      <td>446.000000</td>\n",
              "      <td>0.383838</td>\n",
              "      <td>2.308642</td>\n",
              "      <td>29.699118</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>std</th>\n",
              "      <td>257.353842</td>\n",
              "      <td>0.486592</td>\n",
              "      <td>0.836071</td>\n",
              "      <td>14.526497</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>min</th>\n",
              "      <td>1.000000</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>0.420000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25%</th>\n",
              "      <td>223.500000</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>2.000000</td>\n",
              "      <td>20.125000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>50%</th>\n",
              "      <td>446.000000</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>3.000000</td>\n",
              "      <td>28.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>75%</th>\n",
              "      <td>668.500000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>3.000000</td>\n",
              "      <td>38.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>max</th>\n",
              "      <td>891.000000</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>3.000000</td>\n",
              "      <td>80.000000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "       PassengerId    Survived      Pclass         Age\n",
              "count   891.000000  891.000000  891.000000  714.000000\n",
              "mean    446.000000    0.383838    2.308642   29.699118\n",
              "std     257.353842    0.486592    0.836071   14.526497\n",
              "min       1.000000    0.000000    1.000000    0.420000\n",
              "25%     223.500000    0.000000    2.000000   20.125000\n",
              "50%     446.000000    0.000000    3.000000   28.000000\n",
              "75%     668.500000    1.000000    3.000000   38.000000\n",
              "max     891.000000    1.000000    3.000000   80.000000"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 11
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ORyXDmoyRtAK",
        "colab_type": "text"
      },
      "source": [
        "# Sorting the values by using the sort method."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "EZ5V3Zmvh1Ef",
        "colab_type": "code",
        "outputId": "9c059e6b-dcb3-4892-b627-b8423584c0d6",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df.sort_values(\"Age\")\n",
        "df.head()"
      ],
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Braund, Mr. Owen Harris</td>\n",
              "      <td>male</td>\n",
              "      <td>22.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
              "      <td>female</td>\n",
              "      <td>38.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Heikkinen, Miss. Laina</td>\n",
              "      <td>female</td>\n",
              "      <td>26.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
              "      <td>female</td>\n",
              "      <td>35.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Allen, Mr. William Henry</td>\n",
              "      <td>male</td>\n",
              "      <td>35.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   PassengerId  Survived  ...     Sex   Age\n",
              "0            1         0  ...    male  22.0\n",
              "1            2         1  ...  female  38.0\n",
              "2            3         1  ...  female  26.0\n",
              "3            4         1  ...  female  35.0\n",
              "4            5         0  ...    male  35.0\n",
              "\n",
              "[5 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6-XFGEpdR1fW",
        "colab_type": "text"
      },
      "source": [
        "# Sorting the values according to the age."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "trrCNJzLiNwa",
        "colab_type": "code",
        "outputId": "15246d4a-a17c-40aa-b74c-979d8ca04df6",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df = df.sort_values(\"Age\", ascending = False)\n",
        "df.head(5)"
      ],
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>630</th>\n",
              "      <td>631</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Barkworth, Mr. Algernon Henry Wilson</td>\n",
              "      <td>male</td>\n",
              "      <td>80.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>851</th>\n",
              "      <td>852</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Svensson, Mr. Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>74.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>493</th>\n",
              "      <td>494</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Artagaveytia, Mr. Ramon</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>97</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Goldschmidt, Mr. George B</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>117</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Connors, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>70.5</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  ...   Sex   Age\n",
              "630          631         1  ...  male  80.0\n",
              "851          852         0  ...  male  74.0\n",
              "493          494         0  ...  male  71.0\n",
              "96            97         0  ...  male  71.0\n",
              "116          117         0  ...  male  70.5\n",
              "\n",
              "[5 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 13
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Kz1O1_V6R-HJ",
        "colab_type": "text"
      },
      "source": [
        "# Filtering the dataset, or cleaning the dataset by selecting only the name and many more."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2pRJSwAfj0Tg",
        "colab_type": "code",
        "outputId": "89222e4d-f164-40d6-cae6-4cf9ab0f5fd1",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 79
        }
      },
      "source": [
        "result = df[df['Name'] ==  'Svensson, Mr. Johan'\t]\n",
        "result\n"
      ],
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>851</th>\n",
              "      <td>852</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Svensson, Mr. Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>74.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  Pclass                 Name   Sex   Age\n",
              "851          852         0       3  Svensson, Mr. Johan  male  74.0"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 14
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "l9vxR0OnSoZV",
        "colab_type": "text"
      },
      "source": [
        "# Counting the occurences of variables\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "s9D1EHccSp2m",
        "colab_type": "code",
        "outputId": "22d7f136-96a7-46e0-e13b-a4740832d59a",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 69
        }
      },
      "source": [
        "df[\"Sex\"].value_counts()\n"
      ],
      "execution_count": 15,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "male      577\n",
              "female    314\n",
              "Name: Sex, dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 15
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "rc8RlzWmS4g8",
        "colab_type": "text"
      },
      "source": [
        "# Using .nunique() to count number of unique values that occur in dataset or in a column"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "aKWYElPAS3-c",
        "colab_type": "code",
        "outputId": "5ddbdba8-ba69-43cc-9e96-827f1b341042",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 139
        }
      },
      "source": [
        "df.nunique()"
      ],
      "execution_count": 16,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "PassengerId    891\n",
              "Survived         2\n",
              "Pclass           3\n",
              "Name           891\n",
              "Sex              2\n",
              "Age             88\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "fblOPIVxTLnp",
        "colab_type": "text"
      },
      "source": [
        "# Filtering"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sDD70RkMTzxI",
        "colab_type": "text"
      },
      "source": [
        "**AND operator**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "S6YVgGO9TMnR",
        "colab_type": "code",
        "outputId": "0f64281f-e6f7-4e8c-b540-6d616fb4308e",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1949
        }
      },
      "source": [
        "df_age = df[\"Age\"] < 50\n",
        "df_sex_mask = df[\"Sex\"] == \"female\"\n",
        "df[df_age & df_sex_mask]"
      ],
      "execution_count": 17,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>52</th>\n",
              "      <td>53</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Harper, Mrs. Henry Sleeper (Myna Haxtun)</td>\n",
              "      <td>female</td>\n",
              "      <td>49.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>796</th>\n",
              "      <td>797</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Leader, Dr. Alice (Farnham)</td>\n",
              "      <td>female</td>\n",
              "      <td>49.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>754</th>\n",
              "      <td>755</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Herman, Mrs. Samuel (Jane Laver)</td>\n",
              "      <td>female</td>\n",
              "      <td>48.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>556</th>\n",
              "      <td>557</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Duff Gordon, Lady. (Lucille Christiana Sutherl...</td>\n",
              "      <td>female</td>\n",
              "      <td>48.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>736</th>\n",
              "      <td>737</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Ford, Mrs. Edward (Margaret Ann Watson)</td>\n",
              "      <td>female</td>\n",
              "      <td>48.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>862</th>\n",
              "      <td>863</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Swift, Mrs. Frederick Joel (Margaret Welles Ba...</td>\n",
              "      <td>female</td>\n",
              "      <td>48.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>132</th>\n",
              "      <td>133</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Robins, Mrs. Alexander A (Grace Charity Laury)</td>\n",
              "      <td>female</td>\n",
              "      <td>47.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>871</th>\n",
              "      <td>872</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Beckwith, Mrs. Richard Leonard (Sallie Monypeny)</td>\n",
              "      <td>female</td>\n",
              "      <td>47.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>706</th>\n",
              "      <td>707</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Kelly, Mrs. Florence \"Fannie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>276</th>\n",
              "      <td>277</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Lindblom, Miss. Augusta Charlotta</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>167</th>\n",
              "      <td>168</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Skoog, Mrs. William (Anna Bernhardina Karlsson)</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>362</th>\n",
              "      <td>363</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Barbara, Mrs. (Catherine David)</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>856</th>\n",
              "      <td>857</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Wick, Mrs. George Dennick (Mary Hitchcock)</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>440</th>\n",
              "      <td>441</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Hart, Mrs. Benjamin (Esther Ada Bloomfield)</td>\n",
              "      <td>female</td>\n",
              "      <td>45.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>523</th>\n",
              "      <td>524</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Hippach, Mrs. Louis Albert (Ida Sophia Fischer)</td>\n",
              "      <td>female</td>\n",
              "      <td>44.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>194</th>\n",
              "      <td>195</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Brown, Mrs. James Joseph (Margaret Tobin)</td>\n",
              "      <td>female</td>\n",
              "      <td>44.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>854</th>\n",
              "      <td>855</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Carter, Mrs. Ernest Courtenay (Lilian Hughes)</td>\n",
              "      <td>female</td>\n",
              "      <td>44.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>779</th>\n",
              "      <td>780</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Robert, Mrs. Edward Scott (Elisabeth Walton Mc...</td>\n",
              "      <td>female</td>\n",
              "      <td>43.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>678</th>\n",
              "      <td>679</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Goodwin, Mrs. Frederick (Augusta Tyler)</td>\n",
              "      <td>female</td>\n",
              "      <td>43.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>432</th>\n",
              "      <td>433</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Louch, Mrs. Charles Alexander (Alice Adelaide ...</td>\n",
              "      <td>female</td>\n",
              "      <td>42.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>865</th>\n",
              "      <td>866</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Bystrom, Mrs. (Karolina)</td>\n",
              "      <td>female</td>\n",
              "      <td>42.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>380</th>\n",
              "      <td>381</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Bidois, Miss. Rosalie</td>\n",
              "      <td>female</td>\n",
              "      <td>42.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>272</th>\n",
              "      <td>273</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Mellinger, Mrs. (Elizabeth Anne Maidment)</td>\n",
              "      <td>female</td>\n",
              "      <td>41.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>337</th>\n",
              "      <td>338</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Burns, Miss. Elizabeth Margaret</td>\n",
              "      <td>female</td>\n",
              "      <td>41.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>254</th>\n",
              "      <td>255</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Rosblom, Mrs. Viktor (Helena Wilhelmina)</td>\n",
              "      <td>female</td>\n",
              "      <td>41.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>638</th>\n",
              "      <td>639</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Panula, Mrs. Juha (Maria Emilia Ojala)</td>\n",
              "      <td>female</td>\n",
              "      <td>41.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>609</th>\n",
              "      <td>610</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Shutes, Miss. Elizabeth W</td>\n",
              "      <td>female</td>\n",
              "      <td>40.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>319</th>\n",
              "      <td>320</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Spedden, Mrs. Frederic Oakley (Margaretta Corn...</td>\n",
              "      <td>female</td>\n",
              "      <td>40.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>161</th>\n",
              "      <td>162</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Watt, Mrs. James (Elizabeth \"Bessie\" Inglis Mi...</td>\n",
              "      <td>female</td>\n",
              "      <td>40.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>346</th>\n",
              "      <td>347</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Smith, Miss. Marion Elsie</td>\n",
              "      <td>female</td>\n",
              "      <td>40.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>634</th>\n",
              "      <td>635</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Skoog, Miss. Mabel</td>\n",
              "      <td>female</td>\n",
              "      <td>9.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>852</th>\n",
              "      <td>853</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Boulos, Miss. Nourelain</td>\n",
              "      <td>female</td>\n",
              "      <td>9.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>541</th>\n",
              "      <td>542</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Andersson, Miss. Ingeborg Constanzia</td>\n",
              "      <td>female</td>\n",
              "      <td>9.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>147</th>\n",
              "      <td>148</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Ford, Miss. Robina Maggie \"Ruby\"</td>\n",
              "      <td>female</td>\n",
              "      <td>9.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>25</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Palsson, Miss. Torborg Danira</td>\n",
              "      <td>female</td>\n",
              "      <td>8.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>237</th>\n",
              "      <td>238</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Collyer, Miss. Marjorie \"Lottie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>8.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>535</th>\n",
              "      <td>536</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Hart, Miss. Eva Miriam</td>\n",
              "      <td>female</td>\n",
              "      <td>7.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>720</th>\n",
              "      <td>721</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Harper, Miss. Annie Jessie \"Nina\"</td>\n",
              "      <td>female</td>\n",
              "      <td>6.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>813</th>\n",
              "      <td>814</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Andersson, Miss. Ebba Iris Alfrida</td>\n",
              "      <td>female</td>\n",
              "      <td>6.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>777</th>\n",
              "      <td>778</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Emanuel, Miss. Virginia Ethel</td>\n",
              "      <td>female</td>\n",
              "      <td>5.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>233</th>\n",
              "      <td>234</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Asplund, Miss. Lillian Gertrud</td>\n",
              "      <td>female</td>\n",
              "      <td>5.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>58</th>\n",
              "      <td>59</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>West, Miss. Constance Mirium</td>\n",
              "      <td>female</td>\n",
              "      <td>5.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>448</th>\n",
              "      <td>449</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Baclini, Miss. Marie Catherine</td>\n",
              "      <td>female</td>\n",
              "      <td>5.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>691</th>\n",
              "      <td>692</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Karun, Miss. Manca</td>\n",
              "      <td>female</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>11</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Sandstrom, Miss. Marguerite Rut</td>\n",
              "      <td>female</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>750</th>\n",
              "      <td>751</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Wells, Miss. Joan</td>\n",
              "      <td>female</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>184</th>\n",
              "      <td>185</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Kink-Heilmann, Miss. Luise Gretchen</td>\n",
              "      <td>female</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>618</th>\n",
              "      <td>619</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Becker, Miss. Marion Louise</td>\n",
              "      <td>female</td>\n",
              "      <td>4.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>43</th>\n",
              "      <td>44</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Laroche, Miss. Simonne Marie Anne Andree</td>\n",
              "      <td>female</td>\n",
              "      <td>3.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>374</th>\n",
              "      <td>375</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Palsson, Miss. Stina Viola</td>\n",
              "      <td>female</td>\n",
              "      <td>3.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>642</th>\n",
              "      <td>643</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Skoog, Miss. Margit Elizabeth</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>205</th>\n",
              "      <td>206</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Strom, Miss. Telma Matilda</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>530</th>\n",
              "      <td>531</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Quick, Miss. Phyllis May</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>479</th>\n",
              "      <td>480</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Hirvonen, Miss. Hildur E</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>297</th>\n",
              "      <td>298</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Allison, Miss. Helen Loraine</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>119</th>\n",
              "      <td>120</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Andersson, Miss. Ellis Anna Maria</td>\n",
              "      <td>female</td>\n",
              "      <td>2.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>381</th>\n",
              "      <td>382</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Nakid, Miss. Maria (\"Mary\")</td>\n",
              "      <td>female</td>\n",
              "      <td>1.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>172</th>\n",
              "      <td>173</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnson, Miss. Eleanor Ileen</td>\n",
              "      <td>female</td>\n",
              "      <td>1.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>644</th>\n",
              "      <td>645</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Baclini, Miss. Eugenie</td>\n",
              "      <td>female</td>\n",
              "      <td>0.75</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>469</th>\n",
              "      <td>470</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Baclini, Miss. Helene Barbara</td>\n",
              "      <td>female</td>\n",
              "      <td>0.75</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>239 rows × 6 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  ...     Sex    Age\n",
              "52            53         1  ...  female  49.00\n",
              "796          797         1  ...  female  49.00\n",
              "754          755         1  ...  female  48.00\n",
              "556          557         1  ...  female  48.00\n",
              "736          737         0  ...  female  48.00\n",
              "862          863         1  ...  female  48.00\n",
              "132          133         0  ...  female  47.00\n",
              "871          872         1  ...  female  47.00\n",
              "706          707         1  ...  female  45.00\n",
              "276          277         0  ...  female  45.00\n",
              "167          168         0  ...  female  45.00\n",
              "362          363         0  ...  female  45.00\n",
              "856          857         1  ...  female  45.00\n",
              "440          441         1  ...  female  45.00\n",
              "523          524         1  ...  female  44.00\n",
              "194          195         1  ...  female  44.00\n",
              "854          855         0  ...  female  44.00\n",
              "779          780         1  ...  female  43.00\n",
              "678          679         0  ...  female  43.00\n",
              "432          433         1  ...  female  42.00\n",
              "865          866         1  ...  female  42.00\n",
              "380          381         1  ...  female  42.00\n",
              "272          273         1  ...  female  41.00\n",
              "337          338         1  ...  female  41.00\n",
              "254          255         0  ...  female  41.00\n",
              "638          639         0  ...  female  41.00\n",
              "609          610         1  ...  female  40.00\n",
              "319          320         1  ...  female  40.00\n",
              "161          162         1  ...  female  40.00\n",
              "346          347         1  ...  female  40.00\n",
              "..           ...       ...  ...     ...    ...\n",
              "634          635         0  ...  female   9.00\n",
              "852          853         0  ...  female   9.00\n",
              "541          542         0  ...  female   9.00\n",
              "147          148         0  ...  female   9.00\n",
              "24            25         0  ...  female   8.00\n",
              "237          238         1  ...  female   8.00\n",
              "535          536         1  ...  female   7.00\n",
              "720          721         1  ...  female   6.00\n",
              "813          814         0  ...  female   6.00\n",
              "777          778         1  ...  female   5.00\n",
              "233          234         1  ...  female   5.00\n",
              "58            59         1  ...  female   5.00\n",
              "448          449         1  ...  female   5.00\n",
              "691          692         1  ...  female   4.00\n",
              "10            11         1  ...  female   4.00\n",
              "750          751         1  ...  female   4.00\n",
              "184          185         1  ...  female   4.00\n",
              "618          619         1  ...  female   4.00\n",
              "43            44         1  ...  female   3.00\n",
              "374          375         0  ...  female   3.00\n",
              "642          643         0  ...  female   2.00\n",
              "205          206         0  ...  female   2.00\n",
              "530          531         1  ...  female   2.00\n",
              "479          480         1  ...  female   2.00\n",
              "297          298         0  ...  female   2.00\n",
              "119          120         0  ...  female   2.00\n",
              "381          382         1  ...  female   1.00\n",
              "172          173         1  ...  female   1.00\n",
              "644          645         1  ...  female   0.75\n",
              "469          470         1  ...  female   0.75\n",
              "\n",
              "[239 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 17
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "fZwQ2i6OT9vN",
        "colab_type": "text"
      },
      "source": [
        "**OR operator**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "8Tsj5DIuUAyb",
        "colab_type": "code",
        "outputId": "fcae74bc-81b2-4d49-86a9-2aada60d9309",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df_sex = df[\"Sex\"] == \"Male\"\n",
        "df_age_mask = df[\"Age\"] > 70\n",
        "df[df_sex | df_age_mask]"
      ],
      "execution_count": 18,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>630</th>\n",
              "      <td>631</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Barkworth, Mr. Algernon Henry Wilson</td>\n",
              "      <td>male</td>\n",
              "      <td>80.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>851</th>\n",
              "      <td>852</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Svensson, Mr. Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>74.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>493</th>\n",
              "      <td>494</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Artagaveytia, Mr. Ramon</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>97</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Goldschmidt, Mr. George B</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>117</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Connors, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>70.5</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  ...   Sex   Age\n",
              "630          631         1  ...  male  80.0\n",
              "851          852         0  ...  male  74.0\n",
              "493          494         0  ...  male  71.0\n",
              "96            97         0  ...  male  71.0\n",
              "116          117         0  ...  male  70.5\n",
              "\n",
              "[5 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 18
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "SF--tZmHUWQg",
        "colab_type": "text"
      },
      "source": [
        "# Finding the null values with .isnull()\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "AIH5Uq67UXJ_",
        "colab_type": "code",
        "outputId": "9f6709aa-a5c3-4287-e8f8-f5a93739d6a2",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1949
        }
      },
      "source": [
        "null_mask = df[\"Age\"].isnull()\n",
        "df[null_mask]"
      ],
      "execution_count": 19,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>6</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moran, Mr. James</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>18</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Williams, Mr. Charles Eugene</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>20</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Masselmani, Mrs. Fatima</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>27</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Emir, Mr. Farred Chehab</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>29</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>O'Dwyer, Miss. Ellen \"Nellie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>30</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Todoroff, Mr. Lalio</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>31</th>\n",
              "      <td>32</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Spencer, Mrs. William Augustus (Marie Eugenie)</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>32</th>\n",
              "      <td>33</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Glynn, Miss. Mary Agatha</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>36</th>\n",
              "      <td>37</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Mamee, Mr. Hanna</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>42</th>\n",
              "      <td>43</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Kraeff, Mr. Theodor</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>45</th>\n",
              "      <td>46</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Rogers, Mr. William John</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>46</th>\n",
              "      <td>47</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Lennon, Mr. Denis</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>47</th>\n",
              "      <td>48</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>O'Driscoll, Miss. Bridget</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>48</th>\n",
              "      <td>49</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Samaan, Mr. Youssef</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>55</th>\n",
              "      <td>56</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Woolner, Mr. Hugh</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>64</th>\n",
              "      <td>65</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Stewart, Mr. Albert A</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>65</th>\n",
              "      <td>66</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Moubarek, Master. Gerios</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>76</th>\n",
              "      <td>77</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Staneff, Mr. Ivan</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>77</th>\n",
              "      <td>78</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moutal, Mr. Rahamin Haim</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>82</th>\n",
              "      <td>83</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>McDermott, Miss. Brigdet Delia</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>87</th>\n",
              "      <td>88</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Slocovski, Mr. Selman Francis</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>95</th>\n",
              "      <td>96</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Shorney, Mr. Charles Joseph</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>101</th>\n",
              "      <td>102</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Petroff, Mr. Pastcho (\"Pentcho\")</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>107</th>\n",
              "      <td>108</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Moss, Mr. Albert Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>109</th>\n",
              "      <td>110</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Moran, Miss. Bertha</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>121</th>\n",
              "      <td>122</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moore, Mr. Leonard Charles</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>126</th>\n",
              "      <td>127</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>McMahon, Mr. Martin</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>128</th>\n",
              "      <td>129</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Peter, Miss. Anna</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>140</th>\n",
              "      <td>141</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Boulos, Mrs. Joseph (Sultana)</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>154</th>\n",
              "      <td>155</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Olsen, Mr. Ole Martin</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>718</th>\n",
              "      <td>719</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>McEvoy, Mr. Michael</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>727</th>\n",
              "      <td>728</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Mannion, Miss. Margareth</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>732</th>\n",
              "      <td>733</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Knight, Mr. Robert J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>738</th>\n",
              "      <td>739</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Ivanoff, Mr. Kanio</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>739</th>\n",
              "      <td>740</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Nankoff, Mr. Minko</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>740</th>\n",
              "      <td>741</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Hawksford, Mr. Walter James</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>760</th>\n",
              "      <td>761</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Garfirth, Mr. John</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>766</th>\n",
              "      <td>767</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Brewe, Dr. Arthur Jackson</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>768</th>\n",
              "      <td>769</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moran, Mr. Daniel J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>773</th>\n",
              "      <td>774</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Elias, Mr. Dibo</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>776</th>\n",
              "      <td>777</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Tobin, Mr. Roger</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>778</th>\n",
              "      <td>779</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Kilgannon, Mr. Thomas J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>783</th>\n",
              "      <td>784</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Mr. Andrew G</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>790</th>\n",
              "      <td>791</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Keane, Mr. Andrew \"Andy\"</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>792</th>\n",
              "      <td>793</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Miss. Stella Anna</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>793</th>\n",
              "      <td>794</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Hoyt, Mr. William Fisher</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>815</th>\n",
              "      <td>816</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Fry, Mr. Richard</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>825</th>\n",
              "      <td>826</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Flynn, Mr. John</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>826</th>\n",
              "      <td>827</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Lam, Mr. Len</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>828</th>\n",
              "      <td>829</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>McCormack, Mr. Thomas Joseph</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>832</th>\n",
              "      <td>833</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Saad, Mr. Amin</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>837</th>\n",
              "      <td>838</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sirota, Mr. Maurice</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>839</th>\n",
              "      <td>840</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Marechal, Mr. Pierre</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>846</th>\n",
              "      <td>847</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Mr. Douglas Bullen</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>849</th>\n",
              "      <td>850</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Goldenberg, Mrs. Samuel L (Edwiga Grabowska)</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>859</th>\n",
              "      <td>860</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Razi, Mr. Raihed</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>863</th>\n",
              "      <td>864</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Miss. Dorothy Edith \"Dolly\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>868</th>\n",
              "      <td>869</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>van Melkebeke, Mr. Philemon</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>878</th>\n",
              "      <td>879</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Laleff, Mr. Kristo</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>888</th>\n",
              "      <td>889</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Miss. Catherine Helen \"Carrie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>177 rows × 6 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  ...     Sex Age\n",
              "5              6         0  ...    male NaN\n",
              "17            18         1  ...    male NaN\n",
              "19            20         1  ...  female NaN\n",
              "26            27         0  ...    male NaN\n",
              "28            29         1  ...  female NaN\n",
              "29            30         0  ...    male NaN\n",
              "31            32         1  ...  female NaN\n",
              "32            33         1  ...  female NaN\n",
              "36            37         1  ...    male NaN\n",
              "42            43         0  ...    male NaN\n",
              "45            46         0  ...    male NaN\n",
              "46            47         0  ...    male NaN\n",
              "47            48         1  ...  female NaN\n",
              "48            49         0  ...    male NaN\n",
              "55            56         1  ...    male NaN\n",
              "64            65         0  ...    male NaN\n",
              "65            66         1  ...    male NaN\n",
              "76            77         0  ...    male NaN\n",
              "77            78         0  ...    male NaN\n",
              "82            83         1  ...  female NaN\n",
              "87            88         0  ...    male NaN\n",
              "95            96         0  ...    male NaN\n",
              "101          102         0  ...    male NaN\n",
              "107          108         1  ...    male NaN\n",
              "109          110         1  ...  female NaN\n",
              "121          122         0  ...    male NaN\n",
              "126          127         0  ...    male NaN\n",
              "128          129         1  ...  female NaN\n",
              "140          141         0  ...  female NaN\n",
              "154          155         0  ...    male NaN\n",
              "..           ...       ...  ...     ...  ..\n",
              "718          719         0  ...    male NaN\n",
              "727          728         1  ...  female NaN\n",
              "732          733         0  ...    male NaN\n",
              "738          739         0  ...    male NaN\n",
              "739          740         0  ...    male NaN\n",
              "740          741         1  ...    male NaN\n",
              "760          761         0  ...    male NaN\n",
              "766          767         0  ...    male NaN\n",
              "768          769         0  ...    male NaN\n",
              "773          774         0  ...    male NaN\n",
              "776          777         0  ...    male NaN\n",
              "778          779         0  ...    male NaN\n",
              "783          784         0  ...    male NaN\n",
              "790          791         0  ...    male NaN\n",
              "792          793         0  ...  female NaN\n",
              "793          794         0  ...    male NaN\n",
              "815          816         0  ...    male NaN\n",
              "825          826         0  ...    male NaN\n",
              "826          827         0  ...    male NaN\n",
              "828          829         1  ...    male NaN\n",
              "832          833         0  ...    male NaN\n",
              "837          838         0  ...    male NaN\n",
              "839          840         1  ...    male NaN\n",
              "846          847         0  ...    male NaN\n",
              "849          850         1  ...  female NaN\n",
              "859          860         0  ...    male NaN\n",
              "863          864         0  ...  female NaN\n",
              "868          869         0  ...    male NaN\n",
              "878          879         0  ...    male NaN\n",
              "888          889         0  ...  female NaN\n",
              "\n",
              "[177 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 19
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "XhupjmknUt9w",
        "colab_type": "code",
        "outputId": "550be23c-bf39-4501-a00b-a95ae6fb2c28",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 139
        }
      },
      "source": [
        "df.isnull().sum()\n"
      ],
      "execution_count": 20,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "PassengerId      0\n",
              "Survived         0\n",
              "Pclass           0\n",
              "Name             0\n",
              "Sex              0\n",
              "Age            177\n",
              "dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 20
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "kG9rV4NZU0YU",
        "colab_type": "text"
      },
      "source": [
        "# Dropping a column\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "St1zpvX4U1tI",
        "colab_type": "code",
        "outputId": "0eca5d14-baa9-4cc7-d005-50a366f2109a",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df.drop(labels = [\"Pclass\"], axis=1).head()"
      ],
      "execution_count": 21,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>630</th>\n",
              "      <td>631</td>\n",
              "      <td>1</td>\n",
              "      <td>Barkworth, Mr. Algernon Henry Wilson</td>\n",
              "      <td>male</td>\n",
              "      <td>80.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>851</th>\n",
              "      <td>852</td>\n",
              "      <td>0</td>\n",
              "      <td>Svensson, Mr. Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>74.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>493</th>\n",
              "      <td>494</td>\n",
              "      <td>0</td>\n",
              "      <td>Artagaveytia, Mr. Ramon</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>97</td>\n",
              "      <td>0</td>\n",
              "      <td>Goldschmidt, Mr. George B</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>117</td>\n",
              "      <td>0</td>\n",
              "      <td>Connors, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>70.5</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived                                  Name   Sex   Age\n",
              "630          631         1  Barkworth, Mr. Algernon Henry Wilson  male  80.0\n",
              "851          852         0                   Svensson, Mr. Johan  male  74.0\n",
              "493          494         0               Artagaveytia, Mr. Ramon  male  71.0\n",
              "96            97         0             Goldschmidt, Mr. George B  male  71.0\n",
              "116          117         0                  Connors, Mr. Patrick  male  70.5"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 21
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "cr-iKp_IVJzl",
        "colab_type": "text"
      },
      "source": [
        "**Replacing the values by using the replace method**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "hF3no_nLVJQC",
        "colab_type": "code",
        "outputId": "ed8f7025-c13d-4089-900a-cedff07f9fb1",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1949
        }
      },
      "source": [
        "df.replace(\"Nan\",df[\"Age\"].median())\n",
        "\n",
        "df.replace(\"Masselmani, Mrs. Fatima\", \"Tanu\")\n"
      ],
      "execution_count": 22,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>PassengerId</th>\n",
              "      <th>Survived</th>\n",
              "      <th>Pclass</th>\n",
              "      <th>Name</th>\n",
              "      <th>Sex</th>\n",
              "      <th>Age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>630</th>\n",
              "      <td>631</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Barkworth, Mr. Algernon Henry Wilson</td>\n",
              "      <td>male</td>\n",
              "      <td>80.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>851</th>\n",
              "      <td>852</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Svensson, Mr. Johan</td>\n",
              "      <td>male</td>\n",
              "      <td>74.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>493</th>\n",
              "      <td>494</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Artagaveytia, Mr. Ramon</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>97</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Goldschmidt, Mr. George B</td>\n",
              "      <td>male</td>\n",
              "      <td>71.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>117</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Connors, Mr. Patrick</td>\n",
              "      <td>male</td>\n",
              "      <td>70.5</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>672</th>\n",
              "      <td>673</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Mitchell, Mr. Henry Michael</td>\n",
              "      <td>male</td>\n",
              "      <td>70.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>745</th>\n",
              "      <td>746</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Crosby, Capt. Edward Gifford</td>\n",
              "      <td>male</td>\n",
              "      <td>70.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>33</th>\n",
              "      <td>34</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Wheadon, Mr. Edward H</td>\n",
              "      <td>male</td>\n",
              "      <td>66.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>54</th>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Ostby, Mr. Engelhart Cornelius</td>\n",
              "      <td>male</td>\n",
              "      <td>65.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>280</th>\n",
              "      <td>281</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Duane, Mr. Frank</td>\n",
              "      <td>male</td>\n",
              "      <td>65.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>456</th>\n",
              "      <td>457</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Millet, Mr. Francis Davis</td>\n",
              "      <td>male</td>\n",
              "      <td>65.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>438</th>\n",
              "      <td>439</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Fortune, Mr. Mark</td>\n",
              "      <td>male</td>\n",
              "      <td>64.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>545</th>\n",
              "      <td>546</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Nicholson, Mr. Arthur Ernest</td>\n",
              "      <td>male</td>\n",
              "      <td>64.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>275</th>\n",
              "      <td>276</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Andrews, Miss. Kornelia Theodosia</td>\n",
              "      <td>female</td>\n",
              "      <td>63.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>483</th>\n",
              "      <td>484</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Turkula, Mrs. (Hedwig)</td>\n",
              "      <td>female</td>\n",
              "      <td>63.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>570</th>\n",
              "      <td>571</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>Harris, Mr. George</td>\n",
              "      <td>male</td>\n",
              "      <td>62.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>252</th>\n",
              "      <td>253</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Stead, Mr. William Thomas</td>\n",
              "      <td>male</td>\n",
              "      <td>62.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>829</th>\n",
              "      <td>830</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Stone, Mrs. George Nelson (Martha Evelyn)</td>\n",
              "      <td>female</td>\n",
              "      <td>62.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>555</th>\n",
              "      <td>556</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Wright, Mr. George</td>\n",
              "      <td>male</td>\n",
              "      <td>62.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>625</th>\n",
              "      <td>626</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Sutton, Mr. Frederick</td>\n",
              "      <td>male</td>\n",
              "      <td>61.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>326</th>\n",
              "      <td>327</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Nysveen, Mr. Johan Hansen</td>\n",
              "      <td>male</td>\n",
              "      <td>61.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>170</th>\n",
              "      <td>171</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Van der hoef, Mr. Wyckoff</td>\n",
              "      <td>male</td>\n",
              "      <td>61.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>684</th>\n",
              "      <td>685</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Brown, Mr. Thomas William Solomon</td>\n",
              "      <td>male</td>\n",
              "      <td>60.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>694</th>\n",
              "      <td>695</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Weir, Col. John</td>\n",
              "      <td>male</td>\n",
              "      <td>60.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>587</th>\n",
              "      <td>588</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Frolicher-Stehli, Mr. Maxmillian</td>\n",
              "      <td>male</td>\n",
              "      <td>60.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>366</th>\n",
              "      <td>367</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Warren, Mrs. Frank Manley (Anna Sophia Atkinson)</td>\n",
              "      <td>female</td>\n",
              "      <td>60.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>94</th>\n",
              "      <td>95</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Coxon, Mr. Daniel</td>\n",
              "      <td>male</td>\n",
              "      <td>59.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>232</th>\n",
              "      <td>233</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Sjostedt, Mr. Ernst Adolf</td>\n",
              "      <td>male</td>\n",
              "      <td>59.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>268</th>\n",
              "      <td>269</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Graham, Mrs. William Thompson (Edith Junkins)</td>\n",
              "      <td>female</td>\n",
              "      <td>58.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>12</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Bonnell, Miss. Elizabeth</td>\n",
              "      <td>female</td>\n",
              "      <td>58.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>718</th>\n",
              "      <td>719</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>McEvoy, Mr. Michael</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>727</th>\n",
              "      <td>728</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>Mannion, Miss. Margareth</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>732</th>\n",
              "      <td>733</td>\n",
              "      <td>0</td>\n",
              "      <td>2</td>\n",
              "      <td>Knight, Mr. Robert J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>738</th>\n",
              "      <td>739</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Ivanoff, Mr. Kanio</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>739</th>\n",
              "      <td>740</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Nankoff, Mr. Minko</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>740</th>\n",
              "      <td>741</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Hawksford, Mr. Walter James</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>760</th>\n",
              "      <td>761</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Garfirth, Mr. John</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>766</th>\n",
              "      <td>767</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Brewe, Dr. Arthur Jackson</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>768</th>\n",
              "      <td>769</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Moran, Mr. Daniel J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>773</th>\n",
              "      <td>774</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Elias, Mr. Dibo</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>776</th>\n",
              "      <td>777</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Tobin, Mr. Roger</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>778</th>\n",
              "      <td>779</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Kilgannon, Mr. Thomas J</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>783</th>\n",
              "      <td>784</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Mr. Andrew G</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>790</th>\n",
              "      <td>791</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Keane, Mr. Andrew \"Andy\"</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>792</th>\n",
              "      <td>793</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Miss. Stella Anna</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>793</th>\n",
              "      <td>794</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Hoyt, Mr. William Fisher</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>815</th>\n",
              "      <td>816</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>Fry, Mr. Richard</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>825</th>\n",
              "      <td>826</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Flynn, Mr. John</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>826</th>\n",
              "      <td>827</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Lam, Mr. Len</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>828</th>\n",
              "      <td>829</td>\n",
              "      <td>1</td>\n",
              "      <td>3</td>\n",
              "      <td>McCormack, Mr. Thomas Joseph</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>832</th>\n",
              "      <td>833</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Saad, Mr. Amin</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>837</th>\n",
              "      <td>838</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sirota, Mr. Maurice</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>839</th>\n",
              "      <td>840</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Marechal, Mr. Pierre</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>846</th>\n",
              "      <td>847</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Mr. Douglas Bullen</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>849</th>\n",
              "      <td>850</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>Goldenberg, Mrs. Samuel L (Edwiga Grabowska)</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>859</th>\n",
              "      <td>860</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Razi, Mr. Raihed</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>863</th>\n",
              "      <td>864</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Sage, Miss. Dorothy Edith \"Dolly\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>868</th>\n",
              "      <td>869</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>van Melkebeke, Mr. Philemon</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>878</th>\n",
              "      <td>879</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Laleff, Mr. Kristo</td>\n",
              "      <td>male</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>888</th>\n",
              "      <td>889</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>Johnston, Miss. Catherine Helen \"Carrie\"</td>\n",
              "      <td>female</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>891 rows × 6 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     PassengerId  Survived  ...     Sex   Age\n",
              "630          631         1  ...    male  80.0\n",
              "851          852         0  ...    male  74.0\n",
              "493          494         0  ...    male  71.0\n",
              "96            97         0  ...    male  71.0\n",
              "116          117         0  ...    male  70.5\n",
              "672          673         0  ...    male  70.0\n",
              "745          746         0  ...    male  70.0\n",
              "33            34         0  ...    male  66.0\n",
              "54            55         0  ...    male  65.0\n",
              "280          281         0  ...    male  65.0\n",
              "456          457         0  ...    male  65.0\n",
              "438          439         0  ...    male  64.0\n",
              "545          546         0  ...    male  64.0\n",
              "275          276         1  ...  female  63.0\n",
              "483          484         1  ...  female  63.0\n",
              "570          571         1  ...    male  62.0\n",
              "252          253         0  ...    male  62.0\n",
              "829          830         1  ...  female  62.0\n",
              "555          556         0  ...    male  62.0\n",
              "625          626         0  ...    male  61.0\n",
              "326          327         0  ...    male  61.0\n",
              "170          171         0  ...    male  61.0\n",
              "684          685         0  ...    male  60.0\n",
              "694          695         0  ...    male  60.0\n",
              "587          588         1  ...    male  60.0\n",
              "366          367         1  ...  female  60.0\n",
              "94            95         0  ...    male  59.0\n",
              "232          233         0  ...    male  59.0\n",
              "268          269         1  ...  female  58.0\n",
              "11            12         1  ...  female  58.0\n",
              "..           ...       ...  ...     ...   ...\n",
              "718          719         0  ...    male   NaN\n",
              "727          728         1  ...  female   NaN\n",
              "732          733         0  ...    male   NaN\n",
              "738          739         0  ...    male   NaN\n",
              "739          740         0  ...    male   NaN\n",
              "740          741         1  ...    male   NaN\n",
              "760          761         0  ...    male   NaN\n",
              "766          767         0  ...    male   NaN\n",
              "768          769         0  ...    male   NaN\n",
              "773          774         0  ...    male   NaN\n",
              "776          777         0  ...    male   NaN\n",
              "778          779         0  ...    male   NaN\n",
              "783          784         0  ...    male   NaN\n",
              "790          791         0  ...    male   NaN\n",
              "792          793         0  ...  female   NaN\n",
              "793          794         0  ...    male   NaN\n",
              "815          816         0  ...    male   NaN\n",
              "825          826         0  ...    male   NaN\n",
              "826          827         0  ...    male   NaN\n",
              "828          829         1  ...    male   NaN\n",
              "832          833         0  ...    male   NaN\n",
              "837          838         0  ...    male   NaN\n",
              "839          840         1  ...    male   NaN\n",
              "846          847         0  ...    male   NaN\n",
              "849          850         1  ...  female   NaN\n",
              "859          860         0  ...    male   NaN\n",
              "863          864         0  ...  female   NaN\n",
              "868          869         0  ...    male   NaN\n",
              "878          879         0  ...    male   NaN\n",
              "888          889         0  ...  female   NaN\n",
              "\n",
              "[891 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 22
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "AX07UhV8iv30",
        "colab_type": "text"
      },
      "source": [
        "# Let us calculate how many passengers survived.\n",
        "Here 1 = survived, and 0 = Not survived.\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "4s7zbGQvgiKT",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 121
        },
        "outputId": "5e2f3eae-1259-4fff-92a2-d692389e1b81"
      },
      "source": [
        "count = df['Survived'].value_counts()\n",
        "print(count)\n",
        "# Let us see that in percentage.\n",
        "\n",
        "percentage = df['Survived'].value_counts() * 100 / len(df)\n",
        "print(percentage)"
      ],
      "execution_count": 41,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0    549\n",
            "1    342\n",
            "Name: Survived, dtype: int64\n",
            "0    61.616162\n",
            "1    38.383838\n",
            "Name: Survived, dtype: float64\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ocTuGos1kXMM",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 283
        },
        "outputId": "c739fbd9-3965-4373-f74a-87f9a8da3636"
      },
      "source": [
        "%matplotlib inline\n",
        "color = 0.5\n",
        "df['Survived'].value_counts().plot(kind = 'bar')"
      ],
      "execution_count": 42,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<matplotlib.axes._subplots.AxesSubplot at 0x7f0fcd0e0710>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 42
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAADBxJREFUeJzt3V+MpfVdx/H3p2ypxpouf8YN7q4u\nCZs0eFFKJoipFwpR+WNcLlpCY2RDNtkbmrSpiV29MU28gBtREkOykepitJRUGzaUqGQLMcZAGSzS\nUqyMBLK7AXZKAW1IVcrXi/ltOq67zJmdM5zd775fyeQ8z+/5nfP8Jtm8eXjmnJlUFZKkvt436wVI\nkjaWoZek5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1NymWS8A4OKLL64dO3bMehmSdFZ5\n6qmnvltVc6vNOyNCv2PHDhYWFma9DEk6qyR5aZJ53rqRpOYMvSQ1Z+glqTlDL0nNGXpJas7QS1Jz\nhl6SmjP0ktTcGfGBqbPFjn1fnfUSWnnxjhtnvQTpnOAVvSQ1Z+glqTlDL0nNGXpJas7QS1Jzhl6S\nmjP0ktScoZek5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1NxEoU/yYpJvJnk6ycIYuzDJ\nI0meH48XjPEkuTvJYpJnkly5kd+AJOndreWK/per6oqqmh/7+4BDVbUTODT2Aa4Hdo6vvcA901qs\nJGnt1nPrZhdwYGwfAG5aMX5fLXsc2JzkknWcR5K0DpOGvoC/T/JUkr1jbEtVvTy2XwG2jO2twOEV\nzz0yxv6PJHuTLCRZWFpaOo2lS5ImMenfjP3Fqjqa5KeAR5L868qDVVVJai0nrqr9wH6A+fn5NT1X\nkjS5ia7oq+roeDwGfAW4Cnj1+C2Z8XhsTD8KbF/x9G1jTJI0A6uGPslPJPnJ49vArwLfAg4Cu8e0\n3cCDY/sgcOt4983VwJsrbvFIkt5jk9y62QJ8Jcnx+X9VVX+b5EnggSR7gJeAm8f8h4EbgEXgLeC2\nqa9akjSxVUNfVS8AHznJ+GvAtScZL+D2qaxOkrRufjJWkpoz9JLUnKGXpOYMvSQ1Z+glqTlDL0nN\nGXpJas7QS1Jzhl6SmjP0ktScoZek5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1Jyhl6Tm\nDL0kNWfoJak5Qy9JzRl6SWrO0EtSc4Zekpoz9JLUnKGXpOYMvSQ1N3Hok5yX5BtJHhr7lyZ5Isli\nki8lOX+Mf2DsL47jOzZm6ZKkSazliv7TwHMr9u8E7qqqy4DXgT1jfA/w+hi/a8yTJM3IRKFPsg24\nEfjTsR/gGuDLY8oB4KaxvWvsM45fO+ZLkmZg0iv6PwJ+B3hn7F8EvFFVb4/9I8DWsb0VOAwwjr85\n5kuSZmDV0Cf5deBYVT01zRMn2ZtkIcnC0tLSNF9akrTCJFf0HwN+I8mLwP0s37L5Y2Bzkk1jzjbg\n6Ng+CmwHGMc/BLx24otW1f6qmq+q+bm5uXV9E5KkU1s19FX1u1W1rap2ALcAX6uq3wQeBT4+pu0G\nHhzbB8c+4/jXqqqmumpJ0sTW8z76zwGfTbLI8j34e8f4vcBFY/yzwL71LVGStB6bVp/yI1X1GPDY\n2H4BuOokc34AfGIKa5MkTYGfjJWk5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1Jyhl6Tm\nDL0kNWfoJak5Qy9JzRl6SWrO0EtSc4Zekpoz9JLU3Jr+8IikM9OOfV+d9RJaefGOG2e9hKnyil6S\nmjP0ktScoZek5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1Jyhl6TmDL0kNbdq6JP8WJKv\nJ/mXJM8m+fwYvzTJE0kWk3wpyflj/ANjf3Ec37Gx34Ik6d1MckX/X8A1VfUR4ArguiRXA3cCd1XV\nZcDrwJ4xfw/w+hi/a8yTJM3IqqGvZd8fu+8fXwVcA3x5jB8Abhrbu8Y+4/i1STK1FUuS1mSie/RJ\nzkvyNHAMeAT4d+CNqnp7TDkCbB3bW4HDAOP4m8BFJ3nNvUkWkiwsLS2t77uQJJ3SRKGvqh9W1RXA\nNuAq4MPrPXFV7a+q+aqan5ubW+/LSZJOYU3vuqmqN4BHgV8ANic5/heqtgFHx/ZRYDvAOP4h4LWp\nrFaStGaTvOtmLsnmsf3jwK8Az7Ec/I+PabuBB8f2wbHPOP61qqppLlqSNLlJ/mbsJcCBJOex/B+G\nB6rqoSTfBu5P8gfAN4B7x/x7gb9Isgh8D7hlA9YtSZrQqqGvqmeAj55k/AWW79efOP4D4BNTWZ0k\nad38ZKwkNWfoJak5Qy9JzRl6SWrO0EtSc4Zekpoz9JLUnKGXpOYMvSQ1Z+glqTlDL0nNGXpJas7Q\nS1Jzhl6SmjP0ktScoZek5gy9JDVn6CWpOUMvSc0ZeklqztBLUnOGXpKaM/SS1Jyhl6TmDL0kNWfo\nJak5Qy9JzRl6SWrO0EtSc6uGPsn2JI8m+XaSZ5N8eoxfmOSRJM+PxwvGeJLcnWQxyTNJrtzob0KS\ndGqTXNG/Dfx2VV0OXA3cnuRyYB9wqKp2AofGPsD1wM7xtRe4Z+qrliRNbNXQV9XLVfXPY/s/geeA\nrcAu4MCYdgC4aWzvAu6rZY8Dm5NcMvWVS5ImsqZ79El2AB8FngC2VNXL49ArwJaxvRU4vOJpR8bY\nia+1N8lCkoWlpaU1LluSNKmJQ5/kg8BfA5+pqv9YeayqCqi1nLiq9lfVfFXNz83NreWpkqQ1mCj0\nSd7PcuT/sqr+Zgy/evyWzHg8NsaPAttXPH3bGJMkzcAk77oJcC/wXFX94YpDB4HdY3s38OCK8VvH\nu2+uBt5ccYtHkvQe2zTBnI8BvwV8M8nTY+z3gDuAB5LsAV4Cbh7HHgZuABaBt4DbprpiSdKarBr6\nqvpHIKc4fO1J5hdw+zrXJUmaEj8ZK0nNGXpJas7QS1Jzhl6SmjP0ktScoZek5gy9JDVn6CWpOUMv\nSc0ZeklqztBLUnOGXpKaM/SS1Jyhl6TmDL0kNWfoJak5Qy9JzRl6SWrO0EtSc4Zekpoz9JLUnKGX\npOYMvSQ1Z+glqTlDL0nNGXpJas7QS1Jzhl6Smls19Em+kORYkm+tGLswySNJnh+PF4zxJLk7yWKS\nZ5JcuZGLlyStbpIr+j8HrjthbB9wqKp2AofGPsD1wM7xtRe4ZzrLlCSdrlVDX1X/AHzvhOFdwIGx\nfQC4acX4fbXscWBzkkumtVhJ0tqd7j36LVX18th+BdgytrcCh1fMOzLGJEkzsu4fxlZVAbXW5yXZ\nm2QhycLS0tJ6lyFJOoXTDf2rx2/JjMdjY/wosH3FvG1j7P+pqv1VNV9V83Nzc6e5DEnSak439AeB\n3WN7N/DgivFbx7tvrgbeXHGLR5I0A5tWm5Dki8AvARcnOQL8PnAH8ECSPcBLwM1j+sPADcAi8BZw\n2wasWZK0BquGvqo+eYpD155kbgG3r3dRkqTp8ZOxktScoZek5gy9JDVn6CWpOUMvSc0ZeklqztBL\nUnOGXpKaM/SS1Jyhl6TmDL0kNWfoJak5Qy9JzRl6SWrO0EtSc4Zekpoz9JLUnKGXpOYMvSQ1Z+gl\nqTlDL0nNGXpJas7QS1Jzhl6SmjP0ktScoZek5gy9JDVn6CWpOUMvSc1tSOiTXJfkO0kWk+zbiHNI\nkiYz9dAnOQ/4E+B64HLgk0kun/Z5JEmT2Ygr+quAxap6oar+G7gf2LUB55EkTWDTBrzmVuDwiv0j\nwM+fOCnJXmDv2P1+ku9swFrOVRcD3531IlaTO2e9As2A/zan62cnmbQRoZ9IVe0H9s/q/J0lWaiq\n+VmvQzqR/zZnYyNu3RwFtq/Y3zbGJEkzsBGhfxLYmeTSJOcDtwAHN+A8kqQJTP3WTVW9neRTwN8B\n5wFfqKpnp30evStvielM5b/NGUhVzXoNkqQN5CdjJak5Qy9JzRl6SWpuZu+j13Qk+TDLnzzeOoaO\nAger6rnZrUrSmcQr+rNYks+x/CsmAnx9fAX4or9MTtJxvuvmLJbk34Cfq6r/OWH8fODZqto5m5VJ\n7y7JbVX1Z7Nex7nCK/qz2zvAT59k/JJxTDpTfX7WCziXeI/+7PYZ4FCS5/nRL5L7GeAy4FMzW5UE\nJHnmVIeALe/lWs513ro5yyV5H8u/GnrlD2OfrKofzm5VEiR5Ffg14PUTDwH/VFUn+79RbQCv6M9y\nVfUO8Pis1yGdxEPAB6vq6RMPJHnsvV/Oucsreklqzh/GSlJzhl6SmjP0ktScoZek5v4XlOOeFpX9\nVMgAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "VdEe36TRWnYA",
        "colab_type": "text"
      },
      "source": [
        "**I think this much more than enough for a good start to just starting and master data analysis on the web. Further, I will add more concepts, snippets, and examples in class to make things clear**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "oOijhEeyYMNz",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "[Click Here to watch the video](https://www.youtube.com/watch?v=DNyKDI9pn0Q)\n"
      ]
    }
  ]
}